/**
 * 剑指 Offer 44. 数字序列中某一位的数字
 * https://leetcode-cn.com/problems/shu-zi-xu-lie-zhong-mou-yi-wei-de-shu-zi-lcof/
 */
public class Solutions_Offer_44 {
    public static void main(String[] args) {
//        int n = 3;  // output: 3
//        int n = 11;  // output: 0
//        int n = 12;  // output: 1
//        int n = 210;  // output: 6
//        int n = 365;  // output: 158，5
//        int n = 1000;  // output: 3

//        int result = findNthDigit(n);
//        System.out.print(result + " ");

//        for (int i = 1; i <= 1000; i++) {
        for (int i = 1000; i <= 1000; i++) {
            int result = findNthDigit(i);
            System.out.print(result + " ");
        }
    }

    public static int findNthDigit(int n) {
        return Solutions_400.findNthDigit(n);
    }
}
